package com.allianz.webapps.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.allianz.webapps.https.interfaces.util.ObjectUtil;
import com.allianz.webapps.quopojo.PolBase;
import com.fasterxml.jackson.databind.ObjectMapper;

@Controller
@RequestMapping(value="/quoMdpAction")
public class QuoMdpController {
	
	@Autowired
	private ObjectMapper objectMapper;
	@Autowired
	private ObjectUtil objectUtil;

	@RequestMapping(value="/saveQuoMdp")
	@ResponseBody
	public  String saveMdp(@RequestParam(value="jsonParam") String jsonParam) throws Exception{
		PolBase obj=objectMapper.readValue(jsonParam, PolBase.class);
		String body=objectUtil.requestParam(obj, "quo.saveMDP");
		return body;
	}
}
